<section class="content-header">
    <h1>
        系统设置
        <small></small>
    </h1>
</section>

<!-- Main content -->
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <!-- general form elements -->
            <div class="box">
                <div class="box-header with-border">
                    <h3 class="box-title">系统设置</h3>
                </div>
                <!-- form start -->
                <form action="/admin/config/add" method="post" class="form-horizontal">
                    <div class="box-body">
                        <input class="form-control" name="_id" placeholder="" value="{{config.id}}"
                               type="hidden">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">配置标识（用于C函数调用，只能使用英文且不能重复）</label>

                            <div class="col-sm-10">
                                <input class="form-control" name="key" placeholder="" value="{{config.key}}"
                                       type="text">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">配置标题（用于后台显示的配置标题）</label>

                            <div class="col-sm-10">
                                <input class="form-control" name="title" placeholder="" value="{{config.title}}"
                                       type="text">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">排序（用于分组显示的顺序）</label>

                            <div class="col-sm-10">
                                <input class="form-control" name="sort" placeholder="" value="{{config.sort}}"
                                       type="number">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">配置类型（系统会根据不同类型解析配置值））</label>
                            <div class="col-sm-10">
                                <select name="valueType" class="form-control">
                                    {{#each valueTypes}}
                                    <option value="{{key}}" {{#eq ../config.valueType key}}selected{{/eq}}>{{title}}</option>
                                    {{/each}}
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">配置分组（配置分组 用于批量设置 不分组则不会显示在系统设置中）</label>
                            <div class="col-sm-10">
                            <select name="group" class="form-control">
                                {{#each groups}}
                                <option value="{{key}}" {{#eq ../config.group key}}selected{{/eq}}>{{title}}</option>
                                {{/each}}
                            </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">配置值（配置值）</label>

                            <div class="col-sm-10">
                                <textarea class="form-control" name="value" rows="3">{{config.value}}</textarea>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">配置项（如果是枚举型 需要配置该项）</label>

                            <div class="col-sm-10">
                                <textarea class="form-control" name="extra" rows="3">{{config.extra}}</textarea>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">说明（配置详细说明）</label>

                            <div class="col-sm-10">
                                <textarea class="form-control" name="remark" rows="3">{{config.remark}}</textarea>
                            </div>
                        </div>

                    </div>
                    <!-- /.box-body -->

                    <div class="box-footer">
                        <div class="col-sm-2">
                            <button type="submit" class="btn btn-block btn-danger">保存</button>
                        </div>
                    </div>
                </form>
            </div>
            <!-- /.box -->

        </div>
        <!--/.col (right) -->
    </div>
</section>

